home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / ansivie.com / ANSIVIEW.DOC < prev    next >
Encoding:
Text File  |  1991-01-24  |  8.6 KB  |  235 lines

  1.  
  2.  
  3.                               ANSIVIEW.PAS
  4.  
  5.                            By Marcos R. Della
  6.  
  7.  
  8. OVERVIEW - ANSIView is a unit that will give you the features that you came
  9.            to enjoy from the CRT unit with the earlier versions of Turbo
  10.     Pascal while still retaining the features of the new TVISION enviroment.
  11.     ANSIView provides a single object that will give you the ability to open
  12.     a "CRT" window on your desktop and interface with it exactly as you would
  13.     with a "normal" pascal program.
  14.  
  15.  
  16. USAGE -    To use this with your program, you will be setting it up exactly
  17.            as you would a normal window. That is, you need to initialize it
  18.     with certain parameters and insert it into your desktop chain and you
  19.     need to dispose of the window when you are done.  An example of the
  20.     ANSIView window can be seen in the following:
  21.  
  22.  
  23.     Uses AnsiView;
  24.  
  25.     Var  MyWindow : PANSIWindow;
  26.  
  27.     PROCEDURE MyApp.Init;
  28.     VAR   R : TRect;
  29.           L : TPoint;
  30.     BEGIN
  31.        R.Assign(0,0,50,10);
  32.        L.X := 80;                  {Our "screen" size}
  33.        L.Y := 25;
  34.        MyWindow := NEW(PANSIWindow,Init(R,L,'Demo Window',1));
  35.        IF MyWindow <> NIL THEN
  36.           DeskTop^.Insert(MyWindow);
  37.     END;
  38.  
  39.     NOTE: The L variable in this example defines the actual size of the
  40.     screen that you are trying to set up.  A normal screen size is 80x25,
  41.     however you can set the X value up to MaxViewWidth and the Y value up
  42.     to MaxViewHeight. The Minimums are defined by MinWinSize.
  43.  
  44.     The R variable defines the size of the window that will "actually" be
  45.     on the screen.  It will include scroll bars so that you can scan around
  46.     the entire L defined screen. You can also move the window around and
  47.     Grow or Shrink the displayable view.  The virtual screen will still work
  48.     to the size defined in L.
  49.  
  50.     Just like the TWindow object, you can override anything in here that
  51.     you really want to however I would not recommend it.  User this unit
  52.     as a basis of your own applications! Might just be interesting!
  53.  
  54.  
  55.  
  56. FUNCTIONS - There are quite a few functions available to the TANSIView
  57.             object.  Most of these work exactly as they would in the CRT
  58.     enviroment.  Those that are different I'll mention.
  59.  
  60.  
  61. PROCEDURE PrintLN(s : STRING);
  62.  
  63.     This procedure works like the WRITELN procedure in pascal. It will write
  64.     the string S out at the current cursor location and will screen wrap when
  65.     it hits the right "virtual" edge of the screen. It will also scroll when
  66.     it hits the bottom of the screen.  Note: The displayable scrolling
  67.     region will not follow the writeln's unless AUTOSCROLL is set ON.
  68.  
  69. PROCEDURE Print(s : STRING);
  70.  
  71.     This is the same as the WRITE procedure.  It will do exactly the same as
  72.     the PrintLN above however it will not do a Carriage Return/LineFeed at
  73.     the end of the string.
  74.  
  75. PROCEDURE PrintChar(Ch : CHAR);
  76.  
  77.     A nifty little feature. Since I couldn't make things as nice as the WRITE
  78.     routine where it figures out the type being sent to it, you get a
  79.     seperate procedure to WRITE single characters.
  80.  
  81. PROCEDURE PutChar(X, Y : WORD; Ch : CHAR; Attr : BYTE);
  82.  
  83.     For those times that you want to put a specific character to the virtual
  84.     screen at a specific position.  Note that this will put all 255 characters
  85.     on the screen as represented in the IBM Extended ASCII Character Set.
  86.     If ch is zero (Null) then no modification is made to the character at
  87.     that position.  If Attr is zero then no change is made to the textattr
  88.     at that position.
  89.  
  90. PROCEDURE SetANSI(Flag : BOOLEAN);
  91.  
  92.     Defaults to FALSE.  If you set it to TRUE, then the display routines will
  93.     process ANSI requests as if there was an ANSI driver in memory for the
  94.     virtual screen.  Note that the keyboard re-definitions are not part of
  95.     this implementation, just the video standards.
  96.  
  97. PROCEDURE CursorOn;
  98.  
  99.     This will turn on the cursor at the cursor location when this window is
  100.     sfFocused.  Note that if the cursor is outside of the relative display
  101.     box, then it will not be visible until you manuever the scroll bars
  102.     around to the current cursor location.
  103.  
  104. PROCEDURE CursorOff;
  105.  
  106.     This turns off the cursor in the virtual window.
  107.  
  108. PROCEDURE AutoScrollOn;
  109.  
  110.     Default to TRUE;
  111.     If you set AutoScroll to on, then the system will keep scrolling the
  112.     relative display box to match the cursor location.  This is handy if
  113.     you are dumping a file to the little window and want the user to keep
  114.     up with what is being output.
  115.  
  116. PROCEDURE AutoScrollOff;
  117.  
  118.     This turns off the AutoScroll feature.
  119.  
  120. PROCEDURE ClrScr;
  121.  
  122.     Same as the CRT Unit. Sets the cursor to the 0,0 location.
  123.  
  124. PROCEDURE ClrEol;
  125.  
  126.     Same as the CRT Unit.
  127.  
  128. PROCEDURE DelLine;
  129.  
  130.     Same as the CRT Unit.
  131.  
  132. PROCEDURE GotoXY(X,Y : WORD);
  133.  
  134.     Somewhat the same as the CRT Unit.  This will let you go ANYWHERE in the
  135.     virtual window that you have defined.  If you define a window of 80,1024
  136.     then you can do a GotoXY(50,1000) and the system will go to that virtual
  137.     location!
  138.  
  139. PROCEDURE HighVideo;
  140.  
  141.     Same as the CRT Unit.
  142.  
  143. PROCEDURE InsLine;
  144.  
  145.     Same as the CRT Unit.
  146.  
  147. PROCEDURE LowVideo;
  148.  
  149.     Same as the CRT Unit.
  150.  
  151. PROCEDURE TextBackground(Color : BYTE);
  152.  
  153.     Same as the CRT Unit.
  154.  
  155. PROCEDURE TextColor(Color : BYTE);
  156.  
  157.     Same as the CRT Unit.
  158.  
  159. FUNCTION WhereX : BYTE;
  160.  
  161.     Same as the CRT Unit.
  162.  
  163. FUNCTION WhereY : WORD;
  164.  
  165.     Somewhat the same as the CRT Unit.  This will return a value from 0 on
  166.     through your limit for the virtual screen.  It might come back rather
  167.     large!
  168.  
  169. ------------------------------------------------------------------------------
  170.  
  171. If you have any questions or if you have suggestions (definatly if you have
  172. suggestions!) you can get in contact with me at one of the following...
  173.  
  174.        Marcos R. Della
  175.        5084 Rincon Ave.
  176.        Santa Rosa, CA 95409
  177.  
  178.        CIS: 71675,765
  179.  
  180. Note:  I will be leaving for Saudi Arabia March '91 (Yes, I'm in the Army.
  181.        I'm a Tank Platoon Leader) so if you have any instant pressing
  182.        questions, I'd recommend getting them in before then as having my
  183.        mail forwarded overseas and back again after that might just get you
  184.        a LONG response time.  But keep on trying. I have no idea when I'll
  185.        be back from the dessert.  Might just come home early!
  186.  
  187.  
  188.  
  189.          ----------------end-of-author's-documentation---------------
  190.  
  191.                          Software Library Information:
  192.  
  193.                     This disk copy provided as a service of
  194.  
  195.                            Public (software) Library
  196.  
  197.          We are not the authors of this program, nor are we associated
  198.          with the author in any way other than as a distributor of the
  199.          program in accordance with the author's terms of distribution.
  200.  
  201.          Please direct shareware payments and specific questions about
  202.          this program to the author of the program, whose name appears
  203.          elsewhere in  this documentation. If you have trouble getting
  204.          in touch with the author,  we will do whatever we can to help
  205.          you with your questions. All programs have been tested and do
  206.          run.  To report problems,  please use the form that is in the
  207.          file PROBLEM.DOC on many of our disks or in other written for-
  208.          mat with screen printouts, if possible.  PsL cannot debug pro-
  209.          programs over the telephone, though we can answer questions.
  210.  
  211.          Disks in the PsL are updated  monthly,  so if you did not get
  212.          this disk directly from the PsL, you should be aware that the
  213.          files in this set may no longer be the current versions. Also,
  214.          if you got this disk from another vendor and are having prob-
  215.          lems,  be aware that  some files may have become corrupted or
  216.          lost by that vendor. Get a current, working disk from PsL.
  217.  
  218.          For a copy of the latest monthly software library newsletter
  219.          and a list of the 3,000+ disks in the library, call or write
  220.  
  221.                            Public (software) Library
  222.                                P.O.Box 35705 - F
  223.                             Houston, TX 77235-5705
  224.  
  225.                                 1-800-2424-PSL
  226.                              MC/Visa/AmEx/Discover
  227.  
  228.                           Outside of U.S. or in Texas
  229.                           or for general information,
  230.                               Call 1-713-524-6394
  231.  
  232.                           PsL also has an outstanding
  233.                           catalog for the Macintosh.
  234.  
  235.